home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr38 / dosutl.zip / MACROS.BAT < prev    next >
DOS Batch File  |  1993-06-01  |  7KB  |  159 lines

  1. @echo off
  2. rem  
  3. rem This batch file contains a series of DOSKEY macros.  Each is explained
  4. rem individually below.  To load these macros, you must include the line
  5. rem      DOSKEY /bufsize=1024
  6. rem in your AUTOEXEC.BAT file.  Then execute this batch file (MACROS.BAT)
  7. rem to load your macros into memory.  You will also need to have two files
  8. rem available in your current directory: YES and CR.
  9. rem
  10. rem The CLR macro.
  11. rem   The CLR macro will reset your screen to 80 column color mode
  12. rem and clear the screen.  This is useful if, after exiting a program,
  13. rem you find your machine displaying large letters or garbage instead
  14. rem of 80-column text.
  15. doskey clr=mode co80 $GNUL
  16. rem
  17. rem The DIAL macro.
  18. rem    This macro assumes that you have a 2400 baud modem attached to serial
  19. rem port 2 (COM2).  If your modem is 1200 baud, change the number "2400" in
  20. rem the macro definition to "1200".  If your modem is attached to serial
  21. rem port 1, change the three references to "COM2" below to "COM1".  To dial
  22. rem a number, type:
  23. rem     DIAL number
  24. rem Once the number has been dialed, press any key once the phone has begun
  25. rem ringing and you have lifted the receiver off of the hook.  To wait for
  26. rem a second dial tone (when dialing off post), insert the letter "W" in
  27. rem between the numbers where you want the pause to occur.
  28. doskey dial=mode COM2 2400 $GNUL $Techo ATDT $1; $GCOM2 $Tpause$Techo ATH $GCOM2
  29. rem
  30. rem The DSIZE macro.
  31. rem    Similar to SPACE, DSIZE finds the total amount of space on a disk.
  32. rem     DSIZE d:
  33. rem reports the size of the disk in drive d: (use the appropriate letter
  34. rem for the drive you are checking).
  35. doskey dsize=chkdsk $1 $Bfind "total disk space"
  36. rem
  37. rem The DT macro.
  38. rem    This macro will display the system date and time without prompting
  39. rem you to enter a new value.
  40. doskey dt=time $Lcr$Gtime1.txt$Tdate$Lcr$G$Gtime1.txt$Ttype time1.txt$Bfind "Cur"$Gtime2.txt$Ttype time2.txt
  41. rem
  42. rem The FAST macro.
  43. rem    This macro will speed up the "typematic" rate on most AT keyboards.
  44. doskey fast=mode con rate=30 delay=1
  45. rem
  46. rem The FF macro.
  47. rem    This macro sends a form feed to your printer, ejecting the current
  48. rem page.  This is the same as if you had pressed the form feed button on
  49. rem your printer's console.
  50. doskey ff=echo  $Gprn >NUL
  51. rem
  52. rem The FFIND macro.
  53. rem    This macro will find any file on the current disk.  Simply type
  54. rem     FFIND filename
  55. rem where filename is replaced by the name of the file you wish to locate.
  56. rem Wildcards are OK.
  57. doskey ffind=attrib \$1 /s b$Bmore
  58. rem 
  59. rem
  60. rem The FRAG macro.
  61. rem    This macro checks for fragmented files in the current directory.
  62. rem     FRAG filespec
  63. rem checks the current directory for files meeting the specification 
  64. rem filespec that are fragmented (i.e., occupy non-contiguous disk clusters).
  65. doskey frag=chkdsk $1 $Bfind "non"
  66. rem
  67. rem The GETBACK macro.
  68. rem    This macro quickly UNDELETES a file without asking for confirmation
  69. rem or the files first letter.  It does NOT require MIRROR to be loaded.  You
  70. rem may not specify any wildcards in the file's name.
  71. doskey getback=echo y$1 $Bundelete $1 /dos
  72. rem
  73. rem The HIDE macro.
  74. rem    Use this macro to hide files.  You may hide files using the syntax:
  75. rem     HIDE filespec [/s]
  76. rem All files in the current directory meeting filespec will be hidden.  If
  77. rem you add the optional /s switch, all files meeting filespec in the current
  78. rem directory and all of its subdirectories will be hidden.
  79. doskey hide=attrib +h $*
  80. rem
  81. rem The MACROS macro.
  82. rem    This macro will display a list of all currently loaded DOSKEY macros.
  83. doskey macros=doskey /macros $Bmore
  84. rem
  85. rem The MCD macro.
  86. rem    Use this macro to create a directory and switch to that directory 
  87. rem at the same time.  Syntax:
  88. rem     MCD newdirname
  89. doskey mcd=md $1 $Tcd $1
  90. rem
  91. rem The MOVE macro.
  92. rem    This macro moves files from one place to another.  To move files, type:
  93. rem     MOVE source destination
  94. rem The file(s) specified by source will be copied to destination, and then
  95. rem source will be deleted.
  96. doskey move=xcopy $* $Tdel $1 $Lyes
  97. rem
  98. rem The NEWPATH macro.
  99. rem    Use this macro to temporarily change the DOS path.  Syntax:
  100. rem     NEWPATH newpath
  101. rem Replace newpath with the directories you would like included in the
  102. rem new path, separated by semi-colons.  To restore your previous path,
  103. rem run the batch file RESETP.BAT which is created by NEWPATH.
  104. doskey newpath=echo @echo off $Gresetp.bat $Tpath $G$Gresetp.bat $Tpath=$*
  105. rem
  106. rem The NORMAL macro.
  107. rem    This macro will return the "typematic" rate of most AT keyboards
  108. rem to its default rate.
  109. doskey normal=mode con rate=20 delay=2
  110. rem
  111. rem The NUKE macro.
  112. rem    This macro will remove an entire subdirectory, as well as any
  113. rem files that are in it, WITHOUT any prompts.  This can be very dangerous,
  114. rem so be careful!  It will not remove a directory that contains other
  115. rem subdirectories, however.
  116. doskey nuke=del $1 $Lyes $GNUL $Trd $1 $GNUL
  117. rem
  118. rem The PMEM macro.
  119. rem    Use the PMEM macro to determine how much memory is being taken up by
  120. rem a specific program.  Syntax:
  121. rem     PMEM program
  122. rem Type the "simple" name of the program (only the name you type to start
  123. rem the program, not including an extension such as .COM, .EXE, or .BAT.
  124. doskey pmem=mem /c$Bfind "$1" /i
  125. rem
  126. rem The SCRNSHFT macro.
  127. rem    Use this macro to shift your screen to the left or right on your
  128. rem monitor.  Specify the letter "L" or "R" after typing SCRNSHFT to
  129. rem indicate a shift to the left or right.
  130. doskey scrnshft=mode co80,$1,T
  131. rem
  132. rem The SLOW macro.
  133. rem    This macro will slow down the "typematic" rate on most AT keyboards.
  134. doskey slow=mode con rate=5 delay=4
  135. rem
  136. rem The SPACE macro.
  137. rem    This macro will report the amount of available disk space.  Type
  138. rem     SPACE d:
  139. rem where d: is replaced by the letter of the drive you wish to check.
  140. doskey space=dir $1 $Bfind "free"
  141. rem
  142. rem The UNHIDE macro.
  143. rem    This macro accomplishes the opposite of HIDE; it unhides files.  The
  144. rem syntax is the same as for the HIDE macro.
  145. doskey unhide=attrib -h $*
  146. rem
  147. rem The UPDATE macro.
  148. rem    To change the date and time stamp on a file, type:
  149. rem     UPDATE filename
  150. rem The date and time stamp on the file "filename" will be changed to the
  151. rem current date and time.  Wildcards are not supported by this macro.
  152. doskey update=copy /b $1 +,,$GNUL
  153. rem
  154. rem The MACDOCS macro.
  155. rem    This macro prints the comments ("rem" lines) from the DOS5MACS.BAT file.
  156. doskey macdocs=type dos5macs.bat $Bfind "rem" $Gprn
  157. echo .
  158. echo Type "MACDOCS" at the command line to print a copy of the documentation
  159. echo for the DOS 5.00 macro set.